Skip to main content

Passbook OCR API

API Description

Objective

The Passbook OCR API extracts the textual data from an image or document of a Passbook and returns it in a JSON format. The data fields extracted are as follows:

  • Account Holder Name
  • Bank Name
  • Account Number
  • IFSC Code
  • Account Type
InputOutput
An image or PDF file containing the Passbook The textual information extracted from the document

API URL

https://ind-engine.thomas.hyperverge.co/v1/readPassbook

API Endpoint

readPassbook

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID ( appId ) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThis parameter defines the media type for the request payloadmultipart/form-data
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value.
transactionIdMandatoryA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
imageThe passbook image file for OCR extractionMandatoryThe file format can be JPG, JPEG, PNG, or PDFNot Applicable
Caution
  • If multiple images are sent to the server in the same call, only one of the images will be read. Hence it is advisable to only send one image per call
  • If the PDF file has multiple pages, only the first page will be considered for the OCR extraction.

Request

The following code shows a standard curl request for the API.

curl --location --request POST 'https://ind-engine.thomas.hyperverge.co/v1/readPassbook' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image=@"<path_to_passbook_image>"'

Document Sample

The following is a Passbook document.
passbook_ocr_api

Success Response

The following code is a success response from the API.

{
"status": "success",
"statusCode": "200",
"result": {
"details": [
{
"fieldsExtracted": {
"customerName": {
"value": [
"<Account_Holder_Name>",
"<Joint_Account_Holder_Name>"
]
},
"bankName": {
"value": "<Bank_Name>"
},
"accountNumber": {
"value": "<Account_Number>"
},
"IFSCCode": {
"value": "<IFSC_Code>"
},
"accountType": {
"value": "<Account_Type>"
}
},
"type": "<Document_Type>"
}
]
},
"metadata": {
"requestId": "<Request_ID>",
"transactionId": "<Transaction_ID>"
}
}

Success Response Details

ParameterTypeDescription
statusstringThe status of the request
statusCodeintegerThe HTTP status code of the response
detailsarrayAn array containing the extracted information from the document
fieldsExtractedobjectAn object containing the extracted fields from the document
customerNamearrayThe extracted names of the account holder and the join account holder
bankNamestringThe name of the bank associated with the account
accountNumberstringThe account number extracted from the document
IFSCCodestringThe IFSC code of the bank branch associated with the account
accountTypestringThe type of bank account
typestringThe type of document processed
requestIdstringThe unique identifier for the request
transactionIdstringThe transaction ID associated with the request

Error Response

The following are the error responses for the API.

{
"status": "failure",
"statusCode": 400,
"error": "API call requires one input image"
}

Failure and Error Response Details

The following table lists all error responses.

Status CodeError MessageError Description
400API call requires one input imageThe request missed the image input
400Image size cannot be greater than 6MBThe image size is larger than the allowed limit.
401Missing/Invalid credentialsThe request is either missing the mandatory appId and appKey combination or has invalid values
422Document Not DetectedThe image file in the request is not a valid Passbook document
5xxInternal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: